package com.hqully.smartfumehood.controller;

import com.hqully.smartfumehood.common.exception.JWTException;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
public class ErrorController {
    /**
     * 重新抛出异常
     */
    @RequestMapping("/error/jwt")
    public void rethrow(HttpServletRequest request) {

        throw ((JWTException)request.getAttribute("filter.jwtError"));
    }
}
